//
// Created by Administrator on 2021/5/13.
//

#include <iostream>
#include <vector>
#include <climits>
using namespace std;


class Solution {
private:
    const int MODULO = 1000000007;
public:

    int numWays(int steps, int arrLen)  {
        int maxColumn = min(arrLen - 1, steps); // 最多的列数
        vector<vector<int>> dp(steps + 1, vector<int>(maxColumn + 1));
        dp[0][0] = 1; // 初始位置
        for (int i = 1; i <= steps; i++) {
            for (int j = 0; j <= maxColumn; j++) {
                dp[i][j] = dp[i - 1][j];
                if (j - 1 >= 0) {
                    dp[i][j] = (dp[i][j] + dp[i - 1][j - 1]) % MODULO;
                }
                if (j + 1 <= maxColumn) {
                    dp[i][j] = (dp[i][j] + dp[i - 1][j + 1]) % MODULO;
                }
            }
        }
        return dp[steps][0];
    }
};
class Solution2 {  // 新一次的结果只和上一次 有关 空间优化
public:
    const int MODULO = 1000000007;

    int numWays(int steps, int arrLen) {
        int maxColumn = min(arrLen - 1, steps);
        vector<int> dp(maxColumn + 1);
        dp[0] = 1;
        for (int i = 1; i <= steps; i++) {
            vector<int> dpNext(maxColumn + 1);
            for (int j = 0; j <= maxColumn; j++) {
                dpNext[j] = dp[j];
                if (j - 1 >= 0) {
                    dpNext[j] = (dpNext[j] + dp[j - 1]) % MODULO;
                }
                if (j + 1 <= maxColumn) {
                    dpNext[j] = (dpNext[j] + dp[j + 1]) % MODULO;
                }
            }
            dp = dpNext;
        }
        return dp[0];
    }
};

int main()
{
    Solution sol;
    int steps,arrLen;
    cout << INT_MAX<<endl;
    while (cin >> steps>>arrLen){
        cout << sol.numWays(steps,arrLen) << endl;
    }
//    cout << sol.numWays(4,2)<<endl;
//    cout << sol.numWays(2,4)<<endl;
//    cout << sol.numWays(3,2)<<endl;
//    cout << sol.numWays(27,7)<<endl;
    return 0;
}